<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<?php
	include("/../data.php");

	session_start();
	if(($_SESSION['db_is_logged_in'] == false) || ($_SESSION['profile'] != 'admin'))
		header("location:index.php");
	
	$pass = "";	
	//$connect=mysql_connect("localhost","root","") or die("can't connect this database");
    //mysql_select_db("opensisdata",$connect);
    $connect=mysql_connect($DatabaseServer,$DatabaseUsername,$DatabasePassword) or die("can't connect this database");
	mysql_select_db($DatabaseName,$connect);
	$sql="select * from staff where username='".$_SESSION['username'] ."'";
    $query=mysql_query($sql);
	
	if(mysql_num_rows($query)==0) {
			header("location:index.php");     
    } 
	else{
		$row=mysql_fetch_array($query);         
		$pass = $row["password"];
	}
	
	if(isset($_COOKIE['InputUsername'])){
		if( ($_SESSION['db_is_logged_in'] == true) && ( $_COOKIE["InputUsername"]!=$pass))
		{
			//header("location:index.php");
		}
	}
	
	if( ($_SESSION['db_is_logged_in'] == true)&&( $_SESSION['password']!=$pass))
	{
		header("location:index.php");
	}
?>


<html>
	<head>
		<title>Import</title>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		
		<link href="css/bootstrap.min.css" rel="stylesheet">
		<script src="js/bootstrap.min.js"></script>		
	</head>
  
	<body>	
		<div class="container">	 
			<h1 align="center"><span class="label label-info">CHƯƠNG TRÌNH NHẬP DỮ LIỆU TỪ EXCEL VÀO DATABASE</span></h1>
			<br/>
		</div>

		<br/>
		<br/>
	
		<div class="container marketing">
			<div class="row">
			   <div class="col-sm-5 col-md-6">			   
				  <a href="Student.php" class="thumbnail">
					<span class="label label-info"><i>SINH VIÊN</i></span>
						<img class="img-circle" alt="Student" src="images/student.jpg" style="width: 140px; height: 140px;"> 
						
				  </a>
			   </div>
			   <div class="col-sm-5 col-md-6">
				  <a href="Teacher.php" class="thumbnail">
					<span class="label label-info"><i>GIÁO VIÊN</i></span>
					 <img class="img-circle" alt="Teacher" src="images/teacher.jpg"  style="width: 140px; height: 140px;">        
				  </a>
			   </div>
			</div>
		</div>
	
	</body>
</html>  

